#ifndef Utils_h
#define Utils_h

class CDictionaryStore;
#include <BADESCA.H>

#ifdef __WINS__
	_LIT(KSettingsFileName, "c:\\MrLockSettings.ini");
#else
	_LIT(KSettingsFileName, "c:\\System\\Data\\MrLockSettings.ini");
#endif

class MFileListObserver
{
public:
	virtual void AddStringL(TEntry aEntry, const TDesC& aPath) = 0;
};

class Utils 
{
public:
	enum TDevice { ENokia5800XpressMusic = 0, ENokia6210Navigator, ENokiaN80, ENokiaN95, ENokiaN73, ENokiaN97, ESamsungGTi8910, ENokia5530XpressMusic, ENokia5230, EOther };
	static TDevice GetDevice();
	static void StartExeL(TUid aAppUid);
	static TInt GetActiveProfileId();
	static TInt GetActiveVolumeL();
	static TDes& GetR(TInt aResId);
	static void SaveIntL(CDictionaryStore *aIniFile, const TInt aKey, const TInt aValue);
	static void SaveIntL(const TInt aKey, const TInt aValue);
	static void SaveTimeL(CDictionaryStore *aIniFile, const TInt aKey, const TTime& aValue);
	static void LoadIntL(CDictionaryStore *aIniFile, const TInt aKey, TInt& aValue, TInt aDefaultValue);
	static void LoadIntL(const TInt aKey, TInt& aValue, TInt aDefaultValue);
	static void LoadPeriodL(CDictionaryStore *aIniFile, const TInt aKey, TTimeIntervalSeconds& aValue, TInt aDefaultValue);
	static void LoadTimeL(CDictionaryStore *aIniFile, const TInt aKey, TTime& aValue);
	static void SaveDesL(CDictionaryStore *aIniFile, const TInt aKey, const TDesC& aValue);
	static void LoadDesL(CDictionaryStore *aIniFile, const TInt aKey, TDes& aValue);
	static void SaveIntArrayL(CDictionaryStore* aIniFile, TInt aKey, const TArray< TInt >& aArray);
	static void LoadIntArrayL(CDictionaryStore* aIniFile, TInt aKey, RArray< TInt >& aArray);

	static CDesCArrayFlat* FileListLC(const TDesC& aPath);
	static void FileListL(const TDesC& aPath, MFileListObserver* aObserver);
	static TInt FilesCountL(const TDesC& aPath);
	static TPtrC ExtractName(const TDesC& aFileName);
};

#endif
